<template>
  <view>
<!--    <uni-fab :content="content" horizontal="right" @trigger="handleClick"/>-->
    <view class="swiper-box">
      <scroll-view class="backg">
        <uni-row>
          <uni-col :xs="24" :sm="11" class="info-box" v-for="plan in plans" @click="handleLook(plan.id)" :key="plan.id">
            <uni-row style="padding-left:20px;display: flex;align-items: center;margin-bottom: 10px;">
              <uni-col :span="8">
                <uni-title :title="parseTime(plan.planTime,'{y}-{m}-{d}')" type="h1"/>
              </uni-col>
              <uni-col :span="10" style="color: #7f7f7f;font-size: 16px;">{{ weeks[new Date(plan.planTime).getDay()] }}
              </uni-col>
              <uni-col :span="4" style="color: #7f7f7f;font-size: 16px;">单位: 万</uni-col>
            </uni-row>
            <uni-row style="padding-left:20px;">
              <uni-col :span="20">
                <uni-row>
                  <uni-col :span="14" class="text">
                    <text>换料数量:&nbsp;&nbsp;{{ plan.changeNum / 10000 }}</text>
                  </uni-col>
                </uni-row>
                <uni-row>
                  <uni-col :span="14" class="text">
                    <text>进虫数量:&nbsp;&nbsp;{{ plan.insertNum / 10000}}</text>
                  </uni-col>
                  <uni-col :span="10" class="text">
                    <text> 投入人员:&nbsp;&nbsp;{{ plan.inputStaff}}</text>
                  </uni-col>
                </uni-row>
                <uni-row>
                  <uni-col :span="14" class="text">
                    <text> 剩余数量:&nbsp;&nbsp;{{ plan.residue / 10000}}</text>
                  </uni-col>
                  <uni-col :span="10" class="text">
                    <text>轮休人员:&nbsp;&nbsp;{{ plan.rotationStaff }}</text>
                  </uni-col>
                </uni-row>
              </uni-col>
              <uni-col :span="4" style="text-align: center;margin-top:10px ;">
                <uni-icons type="forward" size="30"></uni-icons>
              </uni-col>
            </uni-row>
          </uni-col>
        </uni-row>
      </scroll-view>
    </view>

  </view>
</template>

<script setup lang="ts">
import {
  loginService
} from "../../pagesVM/login";
import {PlanDataHandle} from "../../pagesVM/plan";
import {parseTime} from "../../util/auth";
import UniCol from "../../uni_modules/uni-row/components/uni-col/uni-col.vue";
import UniRow from "../../uni_modules/uni-row/components/uni-row/uni-row.vue";

const {
  getNetWorkType
} = loginService()

const {
  plans,
  handleClick,
  content,
    handleLook
} = PlanDataHandle()

const weeks = [
  '星期一',
  '星期二',
  '星期三',
  '星期四',
  '星期五',
  '星期六',
  '星期天'
]

</script>

<style lang="scss">
.swiper-box {
  height: 100%;
}

.info-box {
  margin: 10px;
  border-radius: 5px;
  padding: 20px;
  background-color: white;
}

.status {
  text-align: right;
  line-height: 40px;
}

.backg {
  background-color: rgba(240, 240, 240, 0.76);
  height: 100%;
}

.text {
  font-size: 20px;
  color: #7f7f7f;
}
</style>
